package com.panels.cell;

import java.awt.Component;
import java.util.Date;
import java.util.EventObject;
import java.util.Vector;

import javax.swing.AbstractCellEditor;
import javax.swing.JTable;
import javax.swing.event.CellEditorListener;
import javax.swing.table.TableCellEditor;


public class ValueComboBoxCellEditor extends AbstractCellEditor  implements TableCellEditor {

	ValueComboBox vcb=null;
	
	public ValueComboBoxCellEditor(Vector data,boolean withVoid) {
		super();
		this.vcb = new ValueComboBox(data,withVoid);
	}

	
	@Override
	public Object getCellEditorValue() {
		
		
		return vcb.getSelectedCode();
	}


	@Override
	public Component getTableCellEditorComponent(JTable table, Object value,
			boolean isSelected, int row, int column) {
		
		if(value==null)
			return vcb;
	
		String code=(String) value;
		vcb.setSelectedCode(code);
		return vcb;
	}

}
